<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMoonDialLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('moon_dial_log', function (Blueprint $table) {
            $table->increments('id');//自增id
            $table->integer('user_id')->comment('用户id');
            $table->tinyInteger('gift_type')->default(1)->comment('0 勋章 1：头饰 2：气泡 3 金豆  4 靓号');
            $table->integer('gift_value')->default(0)->comment('获取值  天数&金豆数量 & 靓号');
            $table->integer('num_count')->default(0)->comment('获取总数');
            $table->timestamp('created_at')->default(\Illuminate\Support\Facades\DB::raw("CURRENT_TIMESTAMP"))->comment('创建时间');
            $table->index(['user_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('moon_dial_log');
    }
}
